package com.njwb.day09.ens;

public class Person {
    //对象的创建权限转移到类的内部

    private Person(){}
    //这里直接new
    //public static Person instance = new Person();

    private static Person instance =null ;


    public static Person getInstance() {
        if(instance==null) {
            instance = new Person();
        }
        return instance;
    }
}
